var contextPath = "";
$(function () {
    contextPath  = getContextPath();
     var url=contextPath+"/Panel/ShowPressPanel.press";
    //alert(url);
    var data={};
    $.ajaxSetup({
        async : false
    });
    $.post(url,data,function (result,status) {
        if(status=="success"){
            $("#contentnum").html(result.contentnum);
            $("#commentnum").html(result.commentnum);
            $("#contentlugganum").html(result.contentlugganum);
            $("#commentluggagenum").html(result.commentluggagenum);
            var len=result.contentlist.length;
            var lines="<tbody><thead><th></th><th></th><th>作者</th><th>标题</th><th></th><th>修改日期</th><th>阅读次数</th></thead>";
            for(var i=0;i<len;i++){
                var num=result.contentlist[i].content_watched;
                if(num==0){//如果没有看过的话
                    lines+="<tr class='unread checked'>";
                    lines+="<td class='hidden-xs'>"+
                        "<input type='checkbox' class='checkbox'>"+
                        "</td>"+
                        "<td class='hidden-xs'>"+
                        "<i class='fa fa-star icon-state-warning'></i>";
                }
                else{
                    lines+="<tr class='read checked'>";
                    lines+="<td class='hidden-xs'>"+
                        "<input type='checkbox' class='checkbox'>"+
                        "</td>"+
                        "<td class='hidden-xs'>"+
                        "<i class='fa fa-star'></i>";
                }

                lines+="</td>"+
                    "<td class=hidden-xs>";
                lines+=result.contentlist[i].content_author+"</td>"+
                        "<td>"+result.contentlist[i].content_title+"</td>"+
                        "<td></td>"+
                        "<td>"+result.contentlist[i].content_modified+"</td>"+
                        "<td>"+num+"</td></tr>";

            }
            lines+="</tbody>";
            $("#presstable").html(lines);
            
        }
        
    },"json");
    
})